Expand description

The JavaScript’s console object provides access to the browser’s console. Using the console object in Rust/WASM directly is cumbersome as it requires JavaScript glue code. This crate exists to solve this problem by providing a set of ergonomic Rust APIs to deal with the browser console.

Example

The following example logs text to the console using console.log

use gloo_console::log;

let object = JsValue::from("any JsValue can be logged");
log!("text", object)

Macros

Calls console.assert()

Calls console.clear()

A macro similar to dbg! that logs JsValues to console.

A macro similar to dbg! to log to browser console.

Calls console.debug()

Calls console.dir()

Calls console.dirxml()

Calls console.error()

Calls console.group()

Calls console.groupEnd()

Calls console.info()

Calls console.log()

Calls console.table()

Calls console.trace()

Calls console.warn()

Structs

A console time measurement.

A console time measurement.